package router

import (
	"admin/app/http/controller"
	"admin/app/http/middleware"
	"github.com/gin-gonic/gin"
)

/***
 * @description:
 * @param {*gin.Engine} r
 * @return {*}
 */

func Init(r *gin.Engine) *gin.Engine {

	loginPath := r.Group("/")
	controller.LoginRegister(loginPath)

	rootPath := r.Group("/gin")
	rootPath.Use(middleware.AuthJwt())
	{

		userPath := rootPath.Group("/user")
		{
			controller.UserRegister(userPath)
		}

		notePath := rootPath.Group("/note")

		{
			controller.NoteRegister(notePath)
		}

		testPath := rootPath.Group("/test")

		{
			controller.TestRegister(testPath)
		}

	}
	return r
}
